#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTcpSocket>
#include <QPushButton>
#include<QAudioInput>
#include<QAudioDeviceInfo>
#include<QBuffer>
#include <QtCharts/QChartView>
#include <QtCharts/QBarSet>
#include <QtCharts/QLineSeries>
#include <QtCharts/QAreaSeries>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QLabel>
#include <QtCore/QRandomGenerator>
#include <QtWidgets/QApplication>
#include <QtCharts/QValueAxis>

#include <QtWidgets/QWidget>
#include <QtCharts/QChartGlobal>
#include <qchart.h>


QT_CHARTS_BEGIN_NAMESPACE
    class QChartView;

    class QChart;
QT_CHARTS_END_NAMESPACE

typedef QPair<QPointF, QString> Data;
typedef QList<Data> DataList;
typedef QList<DataList> DataTable;

QT_CHARTS_USE_NAMESPACE

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget {
Q_OBJECT

public:

    Widget(QWidget *parent = nullptr);

    ~Widget();

private slots:

    void getInfo();

    void connectSocket();

    void receiveCamera();

    void sendMessage();

    void getCommand();

    void Speech();

    void analyzeSpeech();

    void getToken();

    void audioInit();

    void control(QString open, QString close);

private:


    Ui::Widget *ui;
    QTcpSocket *command_socket;
    QTcpSocket *camera_socket;;
    QTcpSocket *info_socket;;
    QString access_token;
    QBuffer *buffer;
    QAudioDeviceInfo audioDeviceInfo;
    QAudioInput *audioInput;

};

#endif // WIDGET_H
